function [posteriori1,posteriori2,errosParzen, hn, bestVnorm] = ...
    q2b(train_patterns, train_targets, test_patterns, test_targets)

    hn=[0.1 0.5 1 10 20 50 100];
   
    for i=1:length(hn)   
        [targets_parzen, Vnorm(i,:,:)] = Parzen(train_patterns,...
            train_targets, test_patterns,hn(i));
        posteriori1(i) = length(find(targets_parzen==0))...
            /length(targets_parzen);
        posteriori2(i) = length(find(targets_parzen==1))...
            /length(targets_parzen);
        errosParzen(i,:,:,:) = calculateError(targets_parzen, test_targets);
    end

    [v,i] = min(errosParzen(3,:));
    bestVnorm(:,:) = Vnorm(i,:,:);
end      